@extends('admin.layout.main')
@section("content")
    <form class="layui-form" action="/admin/user" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名：</label>
            <div class="layui-input-block">
                <input type="text" name="name"  lay-verify="required" placeholder="请输入用户名"  class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-inline">
                <input type="password" name="password" lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">请务必填写用户名</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">企业地址</label>
            <div id="city">
                <div class="layui-input-inline">
                    <select name="prov" class="prov"></select>
                </div>
                <div class="layui-input-inline">
                    <select name="city" class="city" disabled="disabled"></select>
                </div>
                <div class="layui-input-inline">
                    <select name="dist" class="dist" disabled="disabled"></select>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
                <label class="layui-form-label">联系方式：</label>
                <div class="layui-input-inline">
                    <input type="tel" name="phone"  lay-verify="required|phone" placeholder="请输入联系方式" autocomplete="off" class="layui-input">
                </div>
        </div>
        <div class="layui-form-item">
                <label class="layui-form-label">邮箱地址：</label>
                <div class="layui-input-inline">
                    <input type="text" name="email" lay-verify="email" placeholder="请输入邮箱地址" autocomplete="off" class="layui-input">
                </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
    <script>
        layui.use(['form'], function(){
            var form = layui.form
            //自定义验证规则
            form.verify({
                title: function(value){
                    if(value.length < 5){
                        return '标题至少得5个字符啊';
                    }
                }
                ,pass: [/(.+){6,12}$/, '密码必须6到12位']
            });



        });
    </script>
@endsection